<html>
 <head>
  <title>PIU Browser</title>
  <script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
 </head>
 <body>
  <h1 id="loading">Loading...</h1>
  <script>
function writeTrack(id, title) {
    document.write("<p>Track <a href='/get/"+id+"'>#"+id+"</a>(<a href='/track/"+id+".m3u'>m3u</a>): "+title+"</p>");
}

$.ajax({ url: "/list",
    success: function(xml) {
        $(xml).find("Track").each(function(){
            writeTrack($(this).attr("id"), $(this).attr("title"));
        });
    }
});
  </script>
 </body>
</html>
